package com.zh.umldemo.test02SimpleFactory;

/**
 * @author zh
 * @date 2025/9/7 10:01
 * @description:工厂类，定义静态方法，根据传入的参数，创建不同的产品
 */
public class Factory {
    public static Product getInstance(String productName){

        switch (productName){
            case "A": return new ProductA();
            case "B": return new ProductB();
            case "C": return new ProductC();

            default: return null;
        }
    }
}
